from django.db import models
from django.contrib.auth.models import AbstractUser

from Django_template import settings


class BaseModel(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    # 迁移数据库时 abstract为True 不会生成表
    class Meta:
        abstract = True

class BookUserMode(AbstractUser,BaseModel):
    avatar = models.ImageField(upload_to='static/avatar',default='', verbose_name='头像', null=True)
    class Meta:
        db_table = 'user'
        verbose_name = '用户表'
